import java.util.Arrays;
import java.util.Comparator;

/*
abstract class Shape{
    public abstract void draw();
}

class Rect extends Shape{
    public void draw(){
        System.out.println("画矩形");
    }
}

class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("画❀");
    }
}
public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Shape shape = new Rect();
        drawMap(new Rect());
        drawMap(shape);
    }
}
*/
/*
class  Person {
    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Person)) {
            return false;
        }
        Person person = (Person) obj;
        return this.name.equals(person.name) && this.age == person.age;
    }
}
public class Test{
    public static void main(String[] args) {
        Person person1=new Person("a",10);
        Person person2=new Person("a",10);
        System.out.println(person1==person2);
        System.out.println(person1.equals(person2));
    }
}*/
/*class Student {
    public String name;
    public int age;
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }


    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
class Age implements Comparator<Student>{
    @Override
    public int compare(Student o1, Student o2) {
        return o1.age-o2.age;
    }
}

class Name implements Comparator<Student>{
    @Override
    public int compare(Student o1, Student o2) {
        return o1.name.compareTo(o2.name);
    }
}
public class Test{
    public static void bubblesort(Comparable[] cm){
        for (int i = 0; i < cm.length-1; i++) {
            for (int j = 0; j < cm.length-1-i ; j++) {
                if(cm[j].compareTo(cm[j+1])>0){
                    Comparable tmp = cm[j];
                    cm[j]=cm[j+1];
                    cm[j+1]=tmp;
                }
            }
        }
    }
    public static void main(String[] args) {
        Student student1=new Student("zhangsan",10);
        Student student2=new Student("lisi",15);
      *//*  System.out.println(student1.compareTo(student2));
        Student [] students =new Student[3];
        students[0]=new Student("zhangsan",10);
        students[1]=new Student("lisi",12);
        students[2]=new Student("wangwu",18);
        bubblesort(students);
        System.out.println(Arrays.toString(students));*//*
        System.out.println(student1.name.compareTo(student2.name));
        Age age =new Age();
        Name name =new Name();
        System.out.println(age.compare(student1,student2));
        System.out.println(name.compare(student1,student2));

    }
}*/
/*
class Money implements Cloneable{
    public double money=19.9;
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

class Person implements Cloneable{
    public int age;
    public Money m;

    public Person(int age) {
        this.age = age;
        this.m = new Money();
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp =(Person) super.clone();
        tmp.m=(Money) this.m.clone();
        return tmp;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                '}';
    }
}

public class Test{
    public static void main(String[] args)throws CloneNotSupportedException {
        Person person1 =new Person(10);
        Person person2 =(Person) person1.clone();
        System.out.println(person1);
        System.out.println(person2);
        System.out.println(person1.m.money);
        System.out.println(person2.m.money);
        person2.m.money=99.99;
        System.out.println(person1.m.money);
        System.out.println(person2.m.money);
    }

}
*/